package com.cskaoyan.service;

import com.cskaoyan.bean.VO.WxBrandListVo;
import com.cskaoyan.bean.VO.WxBrandVo;
import com.cskaoyan.bean.common.CommonData;
import com.cskaoyan.mapper.WxBrandMapper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @author:zhangjiaxin
 **/
@Service
@Transactional
public class WxBrandServiceImpl implements WxBrandService {
    @Autowired
    WxBrandMapper wxBrandMapper;

    @Override
    public CommonData queryBrandList(Integer page, Integer limit) {
        List<WxBrandListVo> wxBrandList= wxBrandMapper.selectBrandList(page,limit);
        PageInfo<WxBrandListVo> pageInfo = new PageInfo<>(wxBrandList);
        return CommonData.data(pageInfo);
    }

    @Override
    public WxBrandVo queryBrandById(Integer id) {
        return wxBrandMapper.selectBrandById(id);
    }
}
